﻿using SqlSugar;

namespace Shop.Model.Entity.Goo;

/// <summary>
/// 2.2 商品规格
/// </summary>
[SugarTable("goods_size")]
public class GoodsSize: BaseEntity
{
    /// <summary>
    /// 商品ID
    /// </summary>
    public long GoodsId { get; set; }

    /// <summary>
    /// ERP编码
    /// </summary>
    public string Code { get; set; }
    
    /// <summary>
    /// 缩略图
    /// </summary>
    public string Thumbnail { get; set; }
    
    /// <summary>
    /// 库存
    /// </summary>
    public int Stock { get; set; }
    
    /// <summary>
    /// 是否有效
    /// </summary>
    public bool Valid { get; set; }
    
    /// <summary>
    /// 名称（规格key和value组成）
    /// </summary>
    public string Name { get; set; }
    
    /// <summary>
    /// 名称（规格key和value组成） 维语
    /// </summary>
    public string UighurName { get; set; }
    
    /// <summary>
    /// 创建时间
    /// </summary>
    [SugarColumn(IsOnlyIgnoreInsert = true)]
    public DateTime CreateTime { get; set; }
    
    /// <summary>
    /// 修改时间
    /// </summary>
    public DateTime UpdateTime { get; set; }
    
    /// <summary>
    /// 映射数量
    /// </summary>
    public int Count { get; set; }
    
    /// <summary>
    /// 是否默认规格
    /// </summary>
    public bool IsDefault { get; set; }

    /// <summary>
    /// 单量积分
    /// </summary>
    public int Point { get; set; }

    /// <summary>
    /// 规格价格
    /// </summary>
    [Navigate(NavigateType.OneToOne, nameof(GoodsSize.Id),nameof(GoodsPrice.Size))]
    public GoodsPrice Price { get; set; }
}